package com.linglingC.mapper;

import com.linglingC.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {

    @Select("select * from user where account=#{account} and password=#{password}")
    User login(String account, String password);

    @Select("select * from user where account=#{account} ")
    User getUser(String account);

    @Update("update user set image=#{fileName}")
    void uploadImage(String fileName);

    @Update("update user set updateTime=#{updateTime}")
    void updateTime(LocalDateTime updateTime);

    @Update("update user set password=#{password} where account=#{account}")
    void updatePassword(String password, String account);

    @Update("update user set name=#{name} where account=#{account}")
    void updateName(String name,String account);
}
